package top.codecrab.countDown;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.UUID;

/**
 * @author codecrab
 * @since 2021年06月30日 18:32
 */
@Getter
@AllArgsConstructor
public enum CountryEnum {

    ONE(1, "齐国"),
    TWO(2, "楚国"),
    THREE(3, "赵国"),
    FOUR(4, "魏国"),
    FIVE(5, "韩国"),
    SIX(6, "燕国");

    private final Integer code;
    private final String message;

    public static String forEachFindMessage(int code) {
        CountryEnum[] values = CountryEnum.values();
        for (CountryEnum value : values) {
            if (value.getCode() == code) {
                return value.getMessage();
            }
        }
        return UUID.randomUUID().toString();
    }
}
